//
//  EasyBuyService.m
//  EasyBuy
//
//  Created by Zhu Xiangjun on 9/30/12.
//  Copyright (c) 2012 shen donghao. All rights reserved.
//

#import "EasyBuyService.h"
#import "HttpProxy.h"
#import "FocusParser.h"
#import "RecommendParser.h"
#import "CategoryParser.h"

@implementation EasyBuyService

-(void)executeFocusRequest:(EasyBuyRequest<RequestProtocol> *)request :(NSString *)receiver{
    NSString *urlStr = [request executeToRest];
    HttpProxy *httpProxy = [[HttpProxy alloc] init] ;
    BaseParser<ParseExecutor> *parser = [[FocusParser alloc] init] ;
    [httpProxy executeWithString:urlStr :receiver : parser];
}

-(void)executeRecommendRequest:(EasyBuyRequest<RequestProtocol> *)request :(NSString *)receiver{
    NSString *urlStr = [request executeToRest];
    HttpProxy *httpProxy = [[HttpProxy alloc] init] ;
    BaseParser<ParseExecutor> *parser = [[RecommendParser alloc] init] ;
    [httpProxy executeWithString:urlStr :receiver : parser];
}

-(void)executeCategoryRequest:(EasyBuyRequest<RequestProtocol> *)request :(NSString *)receiver{
    NSString *urlStr = [request executeToRest];
    HttpProxy *httpProxy = [[HttpProxy alloc] init] ;
    BaseParser<ParseExecutor> *parser = [[CategoryParser alloc] init] ;
    [httpProxy executeWithString:urlStr :receiver : parser];
}

-(void)executeObjectDetailRequest:(EasyBuyRequest<RequestProtocol> *)request :(NSString *)receiver{

    NSString *urlStr = [request executeToRest];
    HttpProxy *httpProxy = [[HttpProxy alloc] init] ;
    BaseParser<ParseExecutor> *parser = [[CategoryParser alloc] init] ;
    [httpProxy executeWithString:urlStr :receiver : parser];
}
    

@end
